<template>
<div class="site-header">
  <div class="container w">
    <!-- logo -->
    <div class="head-logo">
      <router-link to="/">
        <img src="https://www-file.huawei.com/-/media/corporate/images/home/logo/huawei_logo.png" width="200">
      </router-link>
    </div>
    <!-- nav -->
    <!-- <div class="header-nav fl">
      <ul class="nav-list">
        <li class="nav-item" @mouseenter="changeHeight(true)" @mouseleave="changeHeight(false)">
          <a href="#" class="link">
            <span class="text">小米手机</span>
          </a>
          <div class="header-nav-menu" :class="{ menuHeight: show }">
            <div class="container w">
              <ul>
                <li class="menu-nav" v-for="(item, index) in 6" :key="index">
                  <a href="#">
                    <div class="figure figure-none">
                      <img src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/b4846501f1e9be04d6d2e859deb0d80e.png?thumb=1&w=320&h=220&f=webp&q=90" alt="小米11" width="160" height="110">
                    </div>
                    <div class="title">小米11</div>
                    <p>3999元起</p>
                  </a>
                </li>
              </ul>
            </div>
          </div>
        </li>
      </ul>
    </div> -->
    <!-- 搜索框 -->
    <div class="header-search fr">
      <form action="" method="GET" class="search-form">
        <input type="text" class="search-text" placeholder="小米11">
        <input type="submit" class="search-btn iconfont" value="">
      </form>
    </div>
  </div>
</div>
</template>

<script>
export default {
  data () {
    return {
      show: false
    }
  },
  methods: {
    changeHeight (state) {
      this.show = state
    }
  }
}
</script>

<style scoped>
.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* site-header */

.site-header {
  position: relative;
  height: 100px;
  z-index: 20;
  border-bottom: 1px solid #eee;
}

.head-logo .text {
  text-align: left;
  text-indent: -9999em;
}

/* header-nav */

.header-nav {
  display: flex;
  align-items: center;
}

.header-nav .nav-category {
  width: 127px;
  padding-right: 15px;
  position: relative;
}

.header-nav .nav-category .header-title {
  display: block;
  padding: 26px 0 38px;
  text-align: right;
  color: #333;
}

.header-nav .nav-list {
  display: flex;
  justify-content: center;
  height: 88px;
  margin: 0;
  font-size: 16px;
  z-index: 10;
}

.header-nav .nav-list .nav-item {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.header-nav .nav-list.nav-item:last-child {
  margin: 0;
}

.header-nav .nav-list .link {
  display: flex;
  align-items: center;
  color: #333;
  transition: color .2s;
}

.header-nav .nav-list .nav-item:hover .link{
  color: #ff6700;
}

.site-category {
  position: absolute;
  top: 88px;
  left: -92px;
  z-index: 21;
  width: 234px;
  height: 460px;
  font-size: 14px;
}

.site-category .category-list .cat-title {
  position: relative;
  display: block;
  height: 42px;
  line-height: 42px;
  padding-left: 30px;
  color: #fff;
}

.site-category .cat-ul {
  height: 420px;
  border: 0;
  color: #fff;
  background: rgba(105, 101, 101, .6);
  padding: 20px 0;
}

.site-category .category-list .cat-icon {
  position: absolute;
  top: 12px;
  right: 20px;
  line-height: 16px;
  font-size: 16px;
}

.site-category .category-list.listBcolor {
  background-color: #ff6700;
}

.site-category .category-list .commodity {
  display: none;
  width: 992px;
  height: 458px;
  border: 1px solid #e0e0e0;
  position: absolute;
  top: 0;
  left: 234px;
  background-color: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .18);
}

.site-category .category-list .comm-3 {
  width: 795px;
}

.site-category .category-list .comm-2 {
  width: 530px;
}

.category-list .commodity .com-ul {
  float: left;
  width: 248px;
  padding: 2px 0;
  height: 458px;
}

.commodity .com-li {
  width: 265px;
  height: 76px;
  float: left;
}

.commodity .com-li img {
  vertical-align: middle;
  float: left;
  margin-right: 12px;
}

.commodity .com-li .text {
  float: left;
  width: 172px;
  line-height: 40px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.header-search {
  width: 296px;
}

.header-search .search-form {
  position: relative;
  width: 296px;
  height: 50px;
  z-index: 20;
}

.header-search .search-form .search-text,
.search-btn {
  position: absolute;
  top: 0;
  border: 1px solid #e0e0e0;
  outline: 0;
  transition: all .2s;
}

.header-search .search-form .search-text.allBorder,
.search-btn.allBorder {
  border: 1px solid #ff6700;
}

.search-form .search-btn {
  right: 0;
  z-index: 2;
  width: 52px;
  height: 50px;
  font-size: 20px;
  line-height: 24px;
  background: #fff;
  color: #616161;
  cursor: pointer;
}

.search-form .search-text {
  right: 51px;
  z-index: 1;
  width: 223px;
  height: 48px;
  padding: 0 10px;
  font-size: 14px;
  line-height: 48px;
}

.search-form .search-btn:hover {
  background-color: #ff6700;
}

/* nav - js -css */

.site-header .header-nav-menu.menuHeight {
  height: 229px;
}

.site-header .header-nav-menu {
  position: absolute;
  top: 101px;
  left: 0;
  z-index: 24;
  width: 100%;
  height: 0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 3px 4px rgba(0, 0, 0, .18);
  transition: box-shadow .2s, height .3s, -webkit-box-shadow .2s;
}

.header-nav-menu ul {
  height: 229px;
}

.header-nav-menu .menu-nav {
  float: left;
  width: 180px;
  padding: 35px 12px 0;
  text-align: center;
  position: relative;
}

.header-nav-menu .nav-item {
  position: relative;
}

.header-nav-menu .figure {
  width: 160px;
  height: 110px;
  margin: 0 auto 16px;
  text-align: center;
}

.header-nav-menu .menu-nav p,
.menu-nav .title {
  font-size: 12px;
}

.header-nav-menu .menu-nav .title {
  line-height: 20px;
  color: #333;
}

.header-nav-menu .menu-nav p {
  line-height: 20px;
  color: #ff6700;
}

.header-nav-menu .container {
  height: 229px;
}

#header-title {
  visibility: hidden;
  position: relative;
}

.header-nav-menu .menu-nav em {
  position: absolute;
  right: 0;
  top: 50px;
  border-right: 1px solid #e0e0e0;
  height: 90px;
}
</style>
